<?php
/*
DEFINE('CONTROLLERS', 'app/controllers/');
DEFINE('VIEWS', 'app/views/');
DEFINE('MODELS', 'app/models/');

require_once 'system/system.php';
require_once 'system/controller.php';
require_once 'system/model.php';
//require_once 'system/bean.php';

function __autoload( $file ){
	require_once MODELS .$file. '.php';
}

$start = new System();

*/



 $_GET['url'] = (isset($_GET['url'])) ? $_GET['url'].'/' : 'index/index';
 $key = $_GET['url']; 
 $separator = explode('/', $key);
 $controller = $separator[0];
 $action = ($separator[1] == null) ? 'index' : $separator[1];
 
 function __autoload( $file ){
 	require_once 'app/models/'.$file.'.php';

 }
 require_once 'system/controller.php';
 require_once 'system/model.php';
 require_once 'system/bean.php';
 
 require_once 'app/controllers/'.$controller.'Controller.php';

 $controller = $controller.'Controller';
 $app = new $controller();
 $app->$action();
 
 

 

 
 
 